﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ShowAssignment.aspx.cs" Inherits="Bitirme.Views.ShowAssignment" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        jQuery(document).ready(function() {
            $.ajax({
                type: "POST",
                contentType: "application/json",
                data: "{}",
                url: "ShowAssignment.aspx/GetEvents",
                dataType: "json",
                success: function(data) {
                    $('div[id*=fullcal]').fullCalendar({
                        header: {
                            left: 'prev,next today',
                            center: 'title',
                            right: 'month,agendaWeek,agendaDay'
                        },
                        editable: false,
                        events: $.map(data.d, function(item, i) {
                            var event = new Object();
                            event.id = item.ID;
                            event.start = new Date(item.StartDate);
                            event.end = new Date(item.EndDate);
                            event.title = item.Title;
                            return event;
                        })
                    });
                    $("div[id=loading]").hide();
                    $("div[id=fullcal]").show();

                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    debugger;
                }
            });

        });
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div id="loading">
            <label style="top: 50%; position: relative">
                loading events....</label>
        </div>
        <div id="fullcal">
        </div>
    </div>
    </asp:Content>
